home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-15 | 6.3 KB | 268 lines | [TEXT/MPS ] |
- #
- # File: MakeExpFile
- #
- # Contains: xxx put contents here xxx
- #
- # Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
- #
- #
-
- If {#} < 2 || `Exists "{1}"`
- Echo "Usage: MakeExpFile outputFile Infile Infile..."
- Echo " The output file must not already exist!"
- Exit 10
- End
- Set OutFile "{1}"
- Set OutName "{1}"
- If "{OutName}" =~ /≈∂:([¬∂:]+)®1/
- Set OutName "{®1}"
- End
- Shift
- Echo "/*" >"{OutFile}"
- Echo " File: {OutName}" >>"{OutFile}"
- Echo "*/" >>"{OutFile}"
- Echo "" >>"{OutFile}"
- Set Files "{Parameters}"
- Set IncList ","
- For Name in {Files}
- Set InFile "{Name}"
- ModifyReadOnly "{InFile}" ∑∑ Dev:Null || Set Status 0
- Target "{InFile}"
- Find • "{InFile}"
- LOOP
- Find /•[ ∂t]*∂#include[ ∂t]+≈∞/ "{InFile}" || Break
- Set Temp "``catenate "{InFile}".§``"
- If "{{Temp}}" =~ /[ ∂t]*∂#include[ ∂t]+(∂<≈∂>)®1≈/
- If "{{IncList}}" !~ /≈,{{®1}},≈/
- Set IncList "{{IncList}}{{®1}},"
- Echo "{{Temp}}" >>"{OutFile}"
- End
- Else If "{{IncList}}" !~ /≈,{{®1}},≈/
- If "{{®1}}" !~ /≈,{{IncList}},≈/
- Set IncList "{{IncList}}{{®1}},"
- Echo "{{Temp}}" >>"{OutFile}"
- End
- Else
- Echo "{{Temp}}" >>"{OutFile}"
- End
- End
- Find • "{InFile}"
- End
- Echo "" >>"{OutFile}"
- Set FndLib 0
- For InFile in {Files}
- Target "{InFile}"
- Find • "{InFile}"
- LOOP
- Find /•[ ∂t]*∂#pragma[ ∂t]+library[ ∂t]≈∂n/ "{InFile}" || Break
- Set Temp "``catenate "{InFile}".§``"
- Set Version ""
- Set ID ""
- Set Flags ""
- If "{{Temp}}" =~ /≈[ ∂t]+id[ ∂t]*=[ ∂t]*([¬ ∂t,]+)®1[ ∂t]*,≈/
- Set ID "{{®1}}"
- Else
- Echo "Poorly formed #pragma library in file {InFile}"
- Echo "--->{{Temp}}"
- Exit 10
- End
- If "{{Temp}}" =~ /≈[ ∂t]+version[ ∂t]*=[ ∂t]*([¬,]+)®1≈/
- Set Version "{®1}"
- Else
- Echo "Poorly formed #pragma library in file {InFile}"
- Echo "--->{{Temp}}"
- Exit 10
- End
- If "{{Temp}}" =~ /≈[ ∂t]+flags[ ∂t]*=(≈)®1/
- Set Flags "{®1}"
- If "{Flags}" =~ /(≈)®1useclientpool(≈)®2/
- Set Flags "memory=client"
- else
- Set Flags ""
- End
- End
- Set FndLib 1
- Break
- End
- If {FndLib}
- Clear § "{InFile}"
- Find §:§!1 "{InFile}"
- If "``catenate "{InFile}.§"``" == ""
- Clear § "{Infile}"
- End
- Break
- End
- End
- If {FndLib}
- Echo "Library" >>"{OutFile}"
- Echo "∂{" >> "{OutFile}"
- Echo "∂tid = {{ID}};" >> "{Outfile}"
- Echo "∂tversion = {Version};" >> "{OutFile}"
- If "{Flags}" != ""
- Echo "∂t{Flags};" >> "{OutFile}"
- End
- Echo "∂};" >>"{OutFile}"
- Echo "" >>"{OutFile}"
- Else
- Echo "WARNING: No #pragma library was found in these files"
- End
-
- For InFile in {Files}
- Target "{InFile}"
- LOOP
- Find • "{InFile}"
- Find /•[ ∂t]*∂#pragma[ ∂t]+class[ ∂t]+≈∂n/ "{InFile}" || Break
- Set Temp "``catenate "{InFile}".§``"
- Set Class ""
- Set Parent ""
- Set ID ""
- Set Flags ""
- If "{{Temp}}" =~ /≈[ ∂t]+name[ ∂t]*=[ ∂t]*([¬ ∂t,]+)®1[ ∂t]*,≈/
- Set Class "{®1}"
- Else
- Echo "Poorly formed #pragma class in file {InFile}"
- Echo "--->{{Temp}}"
- Exit 10
- End
- If "{{Temp}}" =~ /≈[ ∂t]+id[ ∂t]*=[ ∂t]*([¬,]+)®1≈/
- Set ID "{{®1}}"
- Else
- Echo "Poorly formed #pragma class in file {InFile}"
- Echo "--->{{Temp}}"
- Exit 10
- End
- If "{{Temp}}" =~ /≈[ ∂t]+parent[ ∂t]*=[ ∂t]*([¬,]+)®1≈/
- Set Parent "{{®1}}"
- End
- If "{{Temp}}" =~ /≈[ ∂t]+flags[ ∂t]*=(≈)®1/
- Set Flags "{®1}"
- End
- Clear § "{InFile}"
- Find §:§!1 "{InFile}"
- If "``catenate "{InFile}.§"``" == ""
- Clear § "{Infile}"
- End
- If "{{Parent}}" =~ /k(≈)®1ID/
- Echo "Class {Class} : {®1}" >> "{OutFile}"
- Set pID 1
- Else
- Echo "Class {Class}" >> "{OutFile}"
- Set pID 0
- End
- Echo "∂{" >> "{OutFile}"
- Echo "∂tid = {{ID}};" >> "{OutFile}"
- If {pID}
- Echo "∂t{®1} = {{Parent}};" >> "{OutFile}"
- End
- if "{Flags}" =~ /≈newobject≈/ || "{Flags}" =~ /≈preload≈/
- Echo -n "∂tflags = " >> "{OutFile}"
- If "{Flags}" =~ /≈preload≈/ && "{Flags}" =~ /≈newobject≈/
- Echo "newobject, preload;" >> "{OutFile}"
- Else If "{Flags}" =~ /≈preload≈/
- Echo "preload;" >> "{OutFile}"
- Else
- Echo "newobject;" >> "{OutFile}"
- End
- End
- Echo "∂};" >> "{OutFile}"
- Echo "" >>"{OutFile}"
- End
- End
- Echo "" >>"{OutFile}"
- For InFile in {Files}
- Find • "{Infile}"
- LOOP
- Find /•[ ∂t]*FunctionSet[ ∂t]*∂((≈)®1∂)≈∂n/ "{InFile}" || Break;
- Set Temp "``catenate "{InFile}".§``"
- Clear § "{InFile}"
- Find !0 "{InFile}"
- If "{{Temp}}" =~ /[ ∂t]*FunctionSet[ ∂t]*∂((≈)®1∂)≈/
- Echo "FunctionSet {®1}" >> "{OutFile}"
- End
- Echo "∂{" >> "{OutFile}"
- LOOP
- Set Temp "``catenate "{InFile}".§``"
- If "{{Temp}}" =~ /[ ∂t]*∂{«0,1»[ ∂t]*FunctionSetID[ ∂t]*∂(≈∂)≈/
- Break;
- Else
- Clear § "{InFile}"
- Find !0 "{InFile}"
- End
- End
- If "{{Temp}}" =~ /[ ∂t]*∂{«0,1»[ ∂t]*FunctionSetID[ ∂t]*∂((≈)®1∂)≈/
- Mark -y § TempSel "{InFile}"
- Find • "{InFile}"
- Set Temp 0
- Find /•[ ∂t]*#define[ ∂t]*{{®1}}[ ∂t]*(≈)®2/ || Set Temp 1
- If {Temp} == 0
- Set Temp "``catenate "{InFile}".§``"
- If "{{Temp}}" =~ /[ ∂t]*#define[ ∂t]*{{®1}}[ ∂t]*(≈)®2/
- Clear § "{InFile}"
- Find !0 "{InFile}"
- If "``catenate "{InFile}".§``" == ""
- Clear § "{InFile}"
- Find !0 "{InFile}"
- End
- Echo "∂tid = {{®2}};" >> "{OutFile}"
- End
- Else
- Echo "∂tid = {{®1}};" >> "{OutFile}"
- End
- Find TempSel "{InFile}"
- UnMark TempSel "{InFile}"
- End
- Set First 1
- LOOP
- Clear § "{InFile}"
- Find !0 "{InFile}"
- Set Temp "``catenate "{InFile}".§``"
- If "{{Temp}}" =~ /[ ∂t]*Export≈/
- If "{{Temp}}" =~ /[ ∂t]*ExportFunction[ ∂t]*∂(([¬,]+)®3∂,[ ∂t]*([¬,]+)®1≈/
- If "{{®3}}" =~ /≈pascal≈/
- Set type "pascal "
- Else
- Set type ""
- End
- If {First}
- Echo -n "∂texports = {type}{®1}" >>"{OutFile}"
- Set First 0
- Else
- Echo "," >>"{OutFile}"
- Echo -n "∂t∂t∂t {type}{®1}" >>"{OutFile}"
- End
- Else If "{{Temp}}" =~ /[ ∂t]*ExportMemberFunction[ ∂t]*∂(([¬,]+)®4∂,[ ∂t]*([¬,]+)®1,[ ∂t]*([¬,]+)®2≈/
- If "{{®4}}" =~ /≈pascal≈/
- Set type "pascal "
- Else
- Set type ""
- End
- If {First}
- Echo -n "∂texports = {type}{®1}::{{@2}}" >>"{OutFile}"
- Set First 0
- Else
- Echo "," >>"{OutFile}"
- Echo -n "∂t∂t∂t {type}{®1}::{®2}" >>"{OutFile}"
- End
- Else
- Echo "Poorly formed Export line in file {InFile}"
- Echo "--->{{Temp}}"
- Exit 10
- End
- End
- If "{{Temp}}" =~ /≈∂}≈/
- Clear § "{InFile}"
- Find !0 "{InFile}"
- If "``catenate "{InFile}".§``" == ""
- Clear § "{InFile}"
- Find !0 "{InFile}"
- End
- Break
- End
- End
- Echo ";" >>"{OutFile}"
- Echo "};" >>"{OutFile}"
- Echo "" >>"{OutFile}"
- End
- End
- Echo "" >> "{OutFile}"
-